data{
    int<lower=1> N;
    int B[N];
    int VB[N];
    int AVB[N];
}
parameters{
    real a;
    real bVB;
    real bAVB;
}
model{
    vector[N] lp;
    bAVB ~ normal( 0 , 10 );
    bVB ~ normal( 0 , 10 );
    a ~ normal( 0 , 10 );
    for ( i in 1:N ) {
        lp[i] = a + bVB * VB[i] + bAVB * AVB[i];
    }
    B ~ binomial_logit( 1 , lp );
}
generated quantities{
    vector[N] lp;
    real dev;
    dev = 0;
    for ( i in 1:N ) {
        lp[i] = a + bVB * VB[i] + bAVB * AVB[i];
    }
    dev = dev + (-2)*binomial_logit_lpmf( B | 1 , lp );
}
